﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.Data.Transform
{
	public static class ITransformServiceExtensions
	{
		public static ITransformMap<TIn, TOut> AddTransform<TIn, TOut>(this ITransformService transformService)
		{
			return new TransformMap<TIn, TOut>(transformService);
		}

		public static TOut Transform<TIn, TOut>(this ITransformService transformService,
		                                        TIn tIn,
		                                        bool allowErrors = false,
		                                        bool looseTransform = true)
		{
			return (TOut)transformService.Transform(tIn, typeof(TOut), allowErrors, looseTransform);
		}
	}
}